import pandas as pd
from datetime import datetime

data = pd.DataFrame(columns=['author1', 'author2', 'weight', 'time'])
path = 'dblp_coauthor/out.dblp_coauthor'
start_time = datetime.strptime('1994-01-01', '%Y-%m-%d')
end_time = datetime.strptime('1999-01-01', '%Y-%m-%d')

df = pd.read_table(path, parse_dates=[3], header=None, infer_datetime_format=True, error_bad_lines=False)
df = df.loc[(df[3] > start_time) & (df[3] < end_time)]
df.to_csv('dblp_coauthor/dblp_coauthor.csv', index=False)
